/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/* 
 * Copyright (c) 2009 City University of Hong Kong
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License m_version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * Author: Wilson Thong (wilsonwk@ee.cityu.edu.hk) 
 */
#ifndef PACKET_REORDER_CALCULATOR_TAG_H
#define PACKET_REORDER_CALCULATOR_TAG_H

#include "ns3/tag.h"

namespace ns3 {
namespace eecityu {

/**
 * \brief A packet tag for calculating packet reordering metrics
 * A packet tag for marking 
 * - the sequence number of each packet, started with zero;
 * - and the original ttl value.
 */
class PacketReorderCalculatorTag : public Tag
{
public:
  static TypeId GetTypeId (void);
  TypeId GetInstanceTypeId (void) const;

  PacketReorderCalculatorTag (void);
  /**
   * \param s The sequence number assigned to this tag
   */
  void SetSeqNum (uint64_t s);
  /**
   * \return The sequence number in this tag
   */
  uint64_t GetSeqNum () const;
  /**
   * \see Tag
   */
  uint32_t GetSerializedSize (void) const;
  /**
   * \see Tag
   */
  void Serialize (TagBuffer i) const;
  /**
   * \see Tag
   */
  void Deserialize (TagBuffer i);
  /**
   * \see Tag
   */
  void Print (std::ostream &os) const;

private:
  /// The sequence number for a packet
  uint64_t m_seqNum;
};

} // namespace eecityu
} // namespace ns3

#endif // #define PACKET_SEQUENCE_TAG_H
